Ethernet which works on layer two (including Fast Ethernet, Gigabit Ethernet, and 10 Gigabit Ethernet) has been used in a local area network (LAN). At present, application area of layer-2 Ethernet expands to a metro area network (MAN) and a wide area network (WAN) as well as LAN, as can be seen wide area Ethernet services becoming popular. Further, application of a storage area network (SAN) to a metro area is being discussed. Moreover, since data processing speed has increased as the Internet proliferates, optical interface such as fiber channel for use in Gigabit Ethernet, 10 Gigabit Ethernet and SAN has been standardized. In the near future, it is highly probable that a network using an optical switch becomes popular by use of ultra high-speed interface of 10 Gigabit Ethernet class, in which optical signals are being switched in the form of light.
In an electric switch, the spanning tree protocol (STP) is used to secure network redundancy while avoiding a loop phenomenon. STP is a method of configuring a tree structure in a switching network working on layer 2, extending to the entire switches in the network while only one route is existent for each of the entire destinations. With this, while a redundant route is secured even in the event of a failure, logical wiring can be determined avoiding network stoppage caused by a packet loop.
In STP, a switch located at the center of the tree is termed root bridge. As center switch, a switch having a minimum bridge ID (identification number) value is selected. In other switches than the root bridge, a root path cost against the root bridge is calculated. Also, a route having the minimum root path cost is set to a forwarding state (a state transmitting data frames), and other routes having greater root path costs than the above is set to a blocking state (a state suspending transmission of data frames). The path cost of a link between each switch is obtained from the link transmission speed. A port in each switch is shifted from a blocking state, through a listening state and a learning state, to a forwarding state. The above each state will be explained in the following FIG. 1.
FIG. 1 shows a diagram illustrating state transitions in each port of a switch. Each port can take the blocking state, the listening state, the learning state, the forwarding state, and further a disable state. In the blocking state, data traffic is neither transmitted nor received. Namely, data traffic is discarded, and only BPDU (bridge protocol data unit) is received. In the listening state, data traffic is neither transmitted nor received, and the incoming data traffic is discarded, while BPDU is transmitted and received to form an STP tree topology. In the learning state, data traffic is neither transmitted nor received, and the incoming data traffic is discarded. Learning MAC address and generating an MAC address table are performed in this state. Namely, each MAC address provided in the equipment connected to each switch port is retained in this table, correspondingly to each port. When the state is shifted to this learning state, data frames become ready for transfer. In the forwarding state, it becomes possible to transmit/receive both data traffic and BDPU. The disable state is a state other than the above four states, that is, each port stays ineffective or STP is inoperable. Transitions between each state are performed based on each condition corresponding to reference numbers (1), (2), (3), (4) and (5) attached to each arrow shown in FIG. 1. More specifically, the reference number (1) denotes a case that the port becomes either effective or initialized, the reference number (2) denotes a case of the port becoming ineffective, the reference number (3) denotes a case of the port being selected as designated port or root port, the reference number (4) is a case of the port being selected as blocking port, and the reference number (5) is a case when a predetermined time (forward delay: time for shifting to the learning state or the forwarding state) has elapsed.
FIGS. 2A, 2B show diagrams illustrating an exemplary STP tree topology configuration. In a network having physical topology shown in FIG. 2A, logical topology shown in FIG. 2B is structured by exchanging BPDU to determine a route. The procedure for structuring this topology is explained below.
(1) Selecting a Root Bridge
First, a switch having the minimum value of bridge ID (a 64-bit numeral constituted of 16-bit ‘priority’ combined with 48-bit MAC address of each switch) is selected as root bridge.
(2) Selecting Root Ports
In the switches other than the root bridge, a root port, which is a port positioned nearest to the root bridge, is selected. First, a BPDU having a root path cost=0 is transmitted from the root bridge toward switches located downstream. When a switch receives the BPDU, the switch adds the path cost of the port that has received the BPDU, and transfers the new BPDU further to the downstream switches. By repeating the above procedure, each switch receives a plurality of BPDU. The port having received the BPDU including the least root path cost value is selected as root port.
(3) Selecting Designated Ports
All ports in the root bridge are selected as designated ports without exception. Further, among the ports in each segment (where a segment is a link between switches), a port having a shortest route to the root bridge is selected as designated port.
(4) Setting Forwarding Ports
The ports having been selected as root port and designated port are set as forwarding ports.
(5) Setting Blocking Ports
The ports having been selected neither root port nor designated port are set as blocking ports.
Through the above procedure, logical topology having a tree structure (i.e. tree topology) by STP is structured in regard to the network constituted of electric switches.